﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ISessionLogService.cs" company="Özgür Aytekin / Sandro Schnapp">
//   Özgür Aytekin / Sandro Schnapp
// </copyright>
// <summary>
//   Defines the ISessionLogService type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.ServiceModel;
using SqlSystemWatcher.Entities;

namespace SqlSystemWatcher.Service.Wcf
{
    /// <summary>
    ///     The SessionLogService interface.
    /// </summary>
    [ServiceContract]
    public interface ISessionLogService
    {
        /// <summary>
        ///     The get all session logs by wait time filter.
        /// </summary>
        /// <param name="fromDate">
        ///     The from date.
        /// </param>
        /// <param name="toDate">
        ///     The to date.
        /// </param>
        /// <param name="waitTimeFilter">
        ///     The wait time filter.
        /// </param>
        /// <returns>
        ///     The
        ///     <see>
        ///         <cref>List</cref>
        ///     </see>
        ///     .
        /// </returns>
        [OperationContract]
        List<SessionLogBaseEntity> GetAllSessionLogsByWaitTimeFilter(DateTime fromDate, DateTime toDate,
                                                                     int waitTimeFilter);

        /// <summary>
        ///     The get all session logs by processing time filter.
        /// </summary>
        /// <param name="fromDate">
        ///     The from date.
        /// </param>
        /// <param name="toDate">
        ///     The to date.
        /// </param>
        /// <param name="waitTimeFilter">
        ///     The wait time filter.
        /// </param>
        /// <returns>
        ///     The
        ///     <see>
        ///         <cref>List</cref>
        ///     </see>
        ///     .
        /// </returns>
        [OperationContract]
        List<SessionLogBaseEntity> GetAllSessionLogsByCpuTimeFilter(DateTime fromDate, DateTime toDate,
                                                                    int waitTimeFilter);

        /// <summary>
        ///     The get all session logs by reads filter.
        /// </summary>
        /// <param name="fromDate">
        ///     The from date.
        /// </param>
        /// <param name="toDate">
        ///     The to date.
        /// </param>
        /// <param name="readsFilter">
        ///     The reads filter.
        /// </param>
        /// <returns>
        ///     The
        ///     <see>
        ///         <cref>List</cref>
        ///     </see>
        ///     .
        /// </returns>
        [OperationContract]
        List<SessionLogBaseEntity> GetAllSessionLogsByReadsFilter(DateTime fromDate, DateTime toDate, int readsFilter);

        /// <summary>
        ///     The get top wait time count.
        /// </summary>
        /// <param name="fromDate">
        ///     The from date.
        /// </param>
        /// <param name="toDate">
        ///     The to date.
        /// </param>
        /// <returns>The Wait Time</returns>
        [OperationContract]
        int? GetTopWaitTimeCount(DateTime fromDate, DateTime toDate);

        /// <summary>
        ///     The get count of all servers over maximum processor time.
        /// </summary>
        /// <param name="fromDate">
        ///     The from date.
        /// </param>
        /// <param name="toDate">
        ///     The to date.
        /// </param>
        /// <param name="limit">
        ///     The limit.
        /// </param>
        /// <param name="type"> </param>
        /// <returns>
        ///     The maximum Count of Processor Time
        /// </returns>
        [OperationContract]
        int GetCountOfAllServersOverMaximumByType(DateTime fromDate, DateTime toDate, int limit, string type);

        /// <summary>
        ///     The get maximum processor time with instance name.
        /// </summary>
        /// <param name="fromDate">
        ///     The from date.
        /// </param>
        /// <param name="toDate">
        ///     The to date.
        /// </param>
        /// <returns>
        ///     The
        ///     <see>
        ///         <cref>List</cref>
        ///     </see>
        ///     .
        /// </returns>
        [OperationContract]
        List<string> GetMaximumCpuTimeWithInstanceName(DateTime fromDate, DateTime toDate);

        /// <summary>
        ///     The get maximum reads with instance name.
        /// </summary>
        /// <param name="fromDate">
        ///     The from date.
        /// </param>
        /// <param name="toDate">
        ///     The to date.
        /// </param>
        /// <returns>
        ///     The <see cref="List" />.
        /// </returns>
        [OperationContract]
        List<string> GetMaximumReadsWithInstanceName(DateTime fromDate, DateTime toDate);

        /// <summary>
        ///     The get maximum writes with instance name.
        /// </summary>
        /// <param name="fromDate">
        ///     The from date.
        /// </param>
        /// <param name="toDate">
        ///     The to date.
        /// </param>
        /// <returns>
        ///     The <see cref="List" />.
        /// </returns>
        [OperationContract]
        List<string> GetMaximumWritesWithInstanceName(DateTime fromDate, DateTime toDate);

        /// <summary>
        ///     The get maximum wait time with instance name.
        /// </summary>
        /// <param name="fromDate">
        ///     The from date.
        /// </param>
        /// <param name="toDate">
        ///     The to date.
        /// </param>
        /// <returns>
        ///     The <see cref="List" />.
        /// </returns>
        [OperationContract]
        List<string> GetMaximumWaitTimeWithInstanceName(DateTime fromDate, DateTime toDate);


        /// <summary>
        ///     The get count of all servers.
        /// </summary>
        /// <param name="fromDate">
        ///     The from date.
        /// </param>
        /// <param name="toDate">
        ///     The to date.
        /// </param>
        /// <returns>
        ///     The <see cref="int" />.
        /// </returns>
        [OperationContract]
        int GetCountOfAllServers(DateTime fromDate, DateTime toDate);

        /// <summary>
        ///     The get top wait time server and time.
        /// </summary>
        /// <param name="fromDate">
        ///     The from date.
        /// </param>
        /// <param name="toDate">
        ///     The to date.
        /// </param>
        /// <returns>
        ///     The
        ///     <see>
        ///         <cref>List</cref>
        ///     </see>
        ///     .
        /// </returns>
        [OperationContract]
        List<string> GetTopWaitTimeServerAndTime(DateTime fromDate, DateTime toDate);

        /// <summary>
        ///     The get servers over the timeout limit count.
        /// </summary>
        /// <param name="fromDate">
        ///     The from date.
        /// </param>
        /// <param name="toDate">
        ///     The to date.
        /// </param>
        /// <param name="limit">
        ///     The limit.
        /// </param>
        /// <returns>
        ///     The <see cref="int" />.
        /// </returns>
        [OperationContract]
        int GetServersOverTheTimeoutLimitCount(DateTime fromDate, DateTime toDate, int limit);

        /// <summary>
        ///     The get session log average and max read time.
        /// </summary>
        /// <param name="fromDate">
        ///     The from date.
        /// </param>
        /// <param name="toDate">
        ///     The to date.
        /// </param>
        /// <returns>
        ///     The <see cref="List" />.
        /// </returns>
        [OperationContract]
        List<int> GetSessionLogAverageAndMaxReadTime(DateTime fromDate, DateTime toDate);

        /// <summary>
        ///     The get session log average and max write time.
        /// </summary>
        /// <param name="fromDate">
        ///     The from date.
        /// </param>
        /// <param name="toDate">
        ///     The to date.
        /// </param>
        /// <returns>
        ///     The
        ///     <see>
        ///         <cref>List</cref>
        ///     </see>
        ///     .
        /// </returns>
        [OperationContract]
        List<int> GetSessionLogAverageAndMaxWriteTime(DateTime fromDate, DateTime toDate);
    }
}